﻿using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Security.Principal;
using System.Text;
using Newtonsoft.Json;
using SqlSugar;

namespace SuperX.MiddlewareBase
{
    /// <summary>
    /// 数据缓存表
    /// </summary>
    [SugarTable("DataCache")]
    public class DataCache
    {
        /// <summary>
        /// 自增长ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [JsonIgnore]
        public int Id { get; set; }

        /// <summary>
        /// Tag变量名字
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
        public string TagName { get; set; }

        /// <summary>
        /// 队列名称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
        public string QueueName { get; set; }

        /// <summary>
        /// Tag序列化后的值
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
        public string TagValue { get; set; }

        /// <summary>
        /// 插入时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime ChangedTime { get; set; }

        /// <summary>
        /// 资产编码
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text")]
        public string AssetCode { get; set; }

        [JsonIgnore]
        public string Quality { get; set; }
    }
}